package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.query.MedicalTechnologyProjectQuery;
import com.mk.admin.model.query.SelfBillingProjectQuery;
import com.mk.admin.model.vo.MedicalTechnologyProjectVo;
import com.mk.admin.model.vo.SelfBillingProjectVo;
import com.mk.admin.service.MedicalTechnologyProjectService;
import com.mk.admin.service.SelfBillingProjectService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/a/adm/selfBillingProject")
@Api(tags = "自助开单项目")
public class SelfBillingProjectController {
    @Autowired
    private SelfBillingProjectService selfBillingProjectService;

    @PostMapping("/select")
    public ResultDto select(@RequestBody SelfBillingProjectQuery query) {
        return selfBillingProjectService.select(query);
    }

    @PostMapping("/add")
    public ResultDto add(@RequestBody SelfBillingProjectVo vo) {
        return selfBillingProjectService.add(vo);
    }

    @PostMapping("/update")
    public ResultDto update(@RequestBody SelfBillingProjectVo vo) {
        return selfBillingProjectService.update(vo);
    }

    @PostMapping("/delete")
    public ResultDto delete(@RequestBody SelfBillingProjectVo vo) {
        return selfBillingProjectService.delete(vo.getId());
    }

    @PostMapping("/status")
    public ResultDto status(@RequestBody SelfBillingProjectVo vo) {
        return selfBillingProjectService.status(vo.getId());
    }
}
